﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"
    xmlns:helpers="clr-namespace:AACalc.Helpers"
    xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" 
    x:Class="AACalc.SheetPage"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="728" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">
	<phone:PhoneApplicationPage.Resources>
		<DataTemplate x:Key="AttendeeTmpl">
			<Grid Width="180" Height="100" Tap="Grid_Tap_1">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="60"/>
					<ColumnDefinition Width="*"/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="40"/>
					<RowDefinition Height="*"/>
				</Grid.RowDefinitions>
				<TextBlock Text="{Binding Name}" Style="{StaticResource lableBase}" Grid.ColumnSpan="2" />
				<TextBlock Text="Pay" Grid.Row="1" Style="{StaticResource lableBase}" />
				<TextBlock Text="{Binding NeedPay}" Grid.Row="1" Grid.Column="1" Style="{StaticResource lableBase}" />
			</Grid>
		</DataTemplate>
		<DataTemplate x:Key="ActivityTmpl">
			<Grid Width="280" Height="100">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="7*"/>
					<ColumnDefinition Width="3*"/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="40"/>
					<RowDefinition Height="*"/>
				</Grid.RowDefinitions>
				<TextBlock Text="{Binding Name}" Style="{StaticResource lableBase}" VerticalAlignment="Center"/>
				<TextBlock Text="{Binding Cost}" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Style="{StaticResource lableBase}" />
				<StackPanel Grid.Row="1" Orientation="Horizontal" >
					<TextBlock Text="{Binding Attendees.Count}" Style="{StaticResource lableBase}" />
					<TextBlock Text="P" Style="{StaticResource lableBase}" />
				</StackPanel>
			</Grid>
		</DataTemplate>
		<ItemsPanelTemplate x:Key="WrapPanel">
			<telerikPrimitives:RadWrapPanel Orientation="Vertical"/> 
		</ItemsPanelTemplate>
	</phone:PhoneApplicationPage.Resources>

	<!--<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>-->

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled">
            <Grid Margin="0" Background="White">
                <Grid.RowDefinitions>
                    <RowDefinition Height="100"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="400"/>
                    <ColumnDefinition Width="400"/>
                    <ColumnDefinition Width="400"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
				<StackPanel Grid.Row="1" Margin="12,40">
					<TextBlock Text="{Binding Total}" Style="{StaticResource lableBase}" />
					<TextBlock Text="{Binding RealTotal}" Style="{StaticResource lableBase}" />
				</StackPanel>
                <TextBlock x:Name="lblAttendees" Text="Attendees" Grid.Row="0" Grid.Column="1" Style="{StaticResource ColumnTitle}" VerticalAlignment="Bottom"/>
				<ListBox x:Name="lstAttendees" Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Attendees}" ItemTemplate="{StaticResource AttendeeTmpl}" ScrollViewer.VerticalScrollBarVisibility="Disabled" Margin="12,40" ItemsPanel="{StaticResource WrapPanel}" />
                <TextBlock x:Name="lblActivities" Text="Activities" Grid.Row="0" Grid.Column="2" Style="{StaticResource ColumnTitle}" VerticalAlignment="Bottom"/>
            	<ListBox x:Name="lstActivities" Grid.Row="1" Grid.Column="2" ItemsSource="{Binding Activities}" ItemTemplate="{StaticResource ActivityTmpl}" Margin="12,40" ItemsPanel="{StaticResource WrapPanel}"/>
                <TextBlock x:Name="lblTodo" Text="待定" Grid.Row="0" Grid.Column="3" Style="{StaticResource ColumnTitle}" VerticalAlignment="Bottom"/>
            	<TextBlock x:Name="lblTitle" Text="{Binding Name}" Style="{StaticResource SheetTitle}" Grid.ColumnSpan="2" Margin="12,8,0,0" />
            	<TextBlock x:Name="lblCreatedDate" Text="{Binding CreatedTime}" Style="{StaticResource lableBase}" Margin="12,50,12,0"/>
            	<TextBlock x:Name="lblModifiedDate" Text="{Binding ModifiedTime}" Style="{StaticResource lableBase}" Margin="12,74,12,0"/>

            </Grid>
        </ScrollViewer>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button3.png" Text="Button 3"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button4.png" Text="Button 4"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
